<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>MOCKJS</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="./js/require.js"></script>
    <script src="./js/jquery.min.js"></script>
</head>
<body>
    <pre></pre>
</body>
</html>
<script>
// 配置 Mock 路径
require.config({
    paths: {
        mock: 'http://mockjs.com/dist/mock'
    }
})
// 加载 Mock
require(['mock'], function(Mock){
    // 使用 Mock
    var data = Mock.mock({
        'list|1-10': [{
            'id|+1': 1
        }]
    })
    // 输出结果
    console.log(data);
    $("pre").text(JSON.stringify(data, null, 4));
})
</script>